package work2;

public class SonThread extends Thread{
    private Code code;
    public SonThread(Code code) {
        this.code = code;
    }
    @Override
    public void run() {

            for (int i = 0; i < 3; i++) {
                try {
                    code.subRun();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
}
